package day4;

import org.junit.Test;


//无参数构造
public class Student {
    String sid; //学号
    String name; //姓名
    String major; //专业
    String className; //班级

    //无参数构造器
    public Student(){

    }
    /*
     * 有参构造器
     */
    public Student(String sid,String name){
        //this表示当前对象
        this.sid=sid;
        //将局部变量name值赋值给当前对象的name属性
        this.name=name;
    }

    public Student(String sid,String name,String major,String className){
        this.sid=sid;
        this.name=name;
        this.major=major;
        this.className=className;
    }
}

